﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace VFCons
{
	public partial class BinaryParams : UserControl
	{
		public BinaryParams()
		{
			InitializeComponent();
			textBoxBinP.DataBindings.Add("Enabled", radioButton2,"Checked");
		}
		public int BinMethod
		{
			get { return radioButton1.Checked ? 0 : 1; }
			set { _ = value == 0 ? radioButton1.Checked = true : radioButton2.Checked = true; }
		}

		public int ParamValue
		{
			get
			{
				try
				{
					int iv = Convert.ToInt32(textBoxBinP.Text);
					return iv;
				}
				catch (Exception ex)
				{
					MessageBox.Show(this, "二值参数输入错误" + Environment.NewLine + ex.Message, "ERROR");
					return 0;
				}
			}
			set { textBoxBinP.Text = value.ToString(); }
		}
	}
	
}
